<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>教学管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});

		function checkConfigPaperForm(){
			var beginDate = $("#beginDate").val();
			var endDate = $("#endDate").val();

			if(beginDate > endDate){
				window.alertx("请正确选择考试时间！");
				return false;
			}
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/teach/teachDistribute/">教学管理列表</a></li>
		<li><a href="#">编辑下发</a></li>
		<li class="active"><a href="${ctx}/teach/teachDistribute/configPaperForm?paperId=${paperId}">配置试卷</a></li>
	</ul><br/>
	<form id="inputForm" action="${ctx}/teach/teachDistribute/configPaper?paperId=${paperId}" method="post" class="form-horizontal">
		<sys:message content="${message}"/>
		<%--隐藏域--%>
		<label for="teachDistributeId"></label><input value="${teachDistributeId}" id="teachDistributeId" name="teachDistributeId" type="hidden"/>
		<label for="distributeClass"></label><input value="${distributeClass}"  id="distributeClass" name="distributeClass" type="hidden"/>
		<label for="distributeStudent"></label><input value="${distributeStudent}"  id="distributeStudent" name="distributeStudent" type="hidden"/>
		<label for="CourseSystemList"></label><input value="${CourseSystemList}"  id="CourseSystemList" name="CourseSystemList" type="hidden"/>
		<label for="CtfSetList"></label><input value="${CtfSetList}"  id="CtfSetList" name="CtfSetList" type="hidden"/>
		<label for="PaperList"></label><input value="${PaperList}"  id="PaperList" name="PaperList" type="hidden"/>

		<div class="control-group">
			<label class="control-label">考试科目名称：</label>
			<div class="controls">
				<input id="examName" name="examName" value="${teachExam.examName}"  maxlength="100" class="input-xlarge required " type="text"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">考试开始时间：</label>
			<div class="controls">
				<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="40" class="input-mini Wdate beginDateInput required" style="width: 150px"
					   value="<fmt:formatDate value="${teachExam.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline"><font color="red">*</font> </span>

			</div>
		</div>

		<div class="control-group">
			<label class="control-label">考试结束时间：</label>
			<div class="controls">
				<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="40" class="input-mini Wdate endDateInput required" style="width: 150px"
					   value="<fmt:formatDate value="${teachExam.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline"><font color="red">*</font> </span>

			</div>
		</div>

		<div class="control-group">
			<label class="control-label">答题时间：</label>
			<div class="controls">
				<input id="answerTime" name="answerTime" value="${teachExam.answerTime}" maxlength="100" class="input-xlarge required " type="text" />
				<span class="help-inline">分钟 <font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">可参加考试次数：</label>
			<div class="controls">
				<input id="examFrequency" name="examFrequency" value="${teachExam.examFrequency}" maxlength="100" class="input-xlarge required " type="text" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">是否可以查看答题情况：</label>
			<div class="controls">
				<c:choose>
					<c:when test="${teachExam.ifCheckAnswer == '1'}">
						<input type='radio' id='checkAnswerYes' name='ifCheckAnswer' value='1' class="input-xlarge required userName" checked="checked"/>是
						<input type='radio' id='checkAnswerNo' name='ifCheckAnswer' value='0' class="input-xlarge required userName"/>否
					</c:when>
					<c:when test="${teachExam.ifCheckAnswer == '0'}">
						<input type='radio' id='checkAnswerYes' name='ifCheckAnswer' value='1' class="input-xlarge required userName"/>是
						<input type='radio' id='checkAnswerNo' name='ifCheckAnswer' value='0' class="input-xlarge required userName" checked="checked"/>否
					</c:when>
					<c:otherwise>
						<input type='radio' id='checkAnswerYes' name='ifCheckAnswer' value='1' class="input-xlarge required userName"/>是
						<input type='radio' id='checkAnswerNo' name='ifCheckAnswer' value='0' class="input-xlarge required userName"/>否
					</c:otherwise>
				</c:choose>
			</div>
		</div>

		<div class="form-actions">
			<shiro:hasPermission name="teach:teachClass:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" onclick="return checkConfigPaperForm()"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form>
</body>
</html>